// 首页底部的婚礼策划案例展示
//引入express模块
const express = require('express');
//引入数据库连接池模块
const pool = require('../pool.js');
//创建路由器对象
const r = express.Router();
// 1.创建首页底部的婚礼策划案例展示的轮播图路由(测试通过)
r.get('/show/:marry_id', (req, res) => {
    // 获取前台要获取的轮播图id
    var _marry_id = req.params.marry_id;
    // 数据库查询
    var sql = 'select * from scheme_slidepic where marry_id = ?';
    pool.query(sql, [_marry_id], (err, result) => {
        if (err) res.send({ code: 500, msg: "服务器端错误!" });
        if (result.length == 0) {
            res.send({ code: 400, msg: "没有改记录！" });
        } else {
            res.send(result);
        }
    });
});

//导出用户路由模块
module.exports = r;